﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>请假出差</title>
     <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no" />
    <link href="../Frozenui1.3/css/frozen.css" rel="stylesheet" />
    <script src="../JS/layer/layer.m.js"></script>
    <script src="../JS/zepto.min.js"></script>
    <script src="../Frozenui1.3/js/frozen.js"></script>
    <script src="/Scripts/avalon.js"></script>
    <script src="/Scripts/SZHLCommon.js"></script>
    <script src="../JS/MobileCom.js?v=1.1"></script>
    <script>
        var strId = ComFunJS.getQueryString("ID");
        var str = ComFunJS.getQueryString("t");
        
        var qjinfo = avalon.define({
            $id: "qjinfo",
            isforbid: "",
            modelData: {},
            ygData: {},
            sh: function (sts)
            {
                var yn = "";
                if (sts == "1") {
                    yn = "同意"
                }
                else {
                    yn = "拒绝"
                }
                var tc = layer.open({
                    type: 1,
                    title: "审核信息",
                    content: '<div class="ui-form ui-border-t" ><div class="ui-form-item ui-border-b"><label>审核状态</label><span class="wspan">' + yn + '<span/></div><div class="ui-form-item ui-border-b"><label>审核意见</label><input type="text" placeholder="请输入审核意见" id="shyj"/></div></div>',
                    btn: ['确定', '取消'],
                    shadeClose: false,
                    yes: function () {
                        layer.close(tc);
                        var lg = $.loading({
                            content: '保存中...',
                        })
                        $.getJSON('/API/WXAPI.ashx?Action=SPCCQJ&spstatus=' + sts, { P1: strId, P2: $("#shyj").val() }, function (resultData) {
                            lg.hide();
                            if (resultData.ErrorMsg == "") {
                                $(".ui-footer").hide();
                                var el = $.tips({
                                    content: "保存成功",
                                    stayTime: 2000,
                                    type: "success"
                                })
                                el.on("tips:hide", function () {
                                    window.location.href = "UI_QJCC_LIST.html?r=" + Math.random();
                                })
                            }
                            else {
                                $.tips({
                                    content: "保存失败，原因：" + resultData.ErrorMsg,
                                    stayTime: 2000,
                                    type: "warn"
                                })
                            }
                        })
                    }, no: function () {
                    }
                })
            }
        });
        avalon.ready(function () {
            if (strId != null) {
                var lg = $.loading({
                    content: '加载中...',
                })
                $.getJSON('/API/WXAPI.ashx?Action=GETCCQJMODEL&r=' + Math.random(), { p1: strId }, function (resultData) {
                    lg.hide();
                    if (resultData.ErrorMsg == "") {
                        qjinfo.modelData = resultData.Result;
                        qjinfo.isforbid = resultData.Result1;
                        var s = MobileCom.getqjstatus(resultData.Result.SPStatus, resultData.Result.SPStatus1, resultData.Result1);
                        if (s == "0") {
                            if (str == "1") {
                                $(".ui-footer").show();
                            }
                        }

                        if (resultData.Result.ChaoSongRen != null) {
                            $.getJSON('/API/SZHLAPI.ashx?Action=GETUSERSBYUSERNAME&r=' + Math.random(), { P1: resultData.Result.ChaoSongRen }, function (data) {

                                if (data.ErrorMsg == "") {
                                    qjinfo.ygData = data.Result;
                                }
                            })
                        }
                    }
                })
            }
            
        })

        function qjzt(str1, str2, str3) {
            var s = MobileCom.getqjstatus(str1, str2, str3);
            if (s == "0") {
                return '正在审核';
            }
            else if (s == "1") {
                return '已审核';
            }
            else if (s == "2") {
                return '已退回';
            }
        }
    </script>
    <style>
        .ui-form-item .wspan {
            width: 100%;
            -webkit-box-sizing: border-box;
            box-sizing: border-box;
            -webkit-appearance: none;
            border: 0;
            background: 0 0;
            padding-left: 95px;
        }
        .ms-controller, [ms-controller] {
            display: none;
        }
    </style>

</head>
<body ms-controller="qjinfo">
    <header class="ui-header ui-header-stable ui-border-b">
        <i class="ui-icon-return" onclick="history.back(-1)"></i><h1>请假出差信息查看</h1>
    </header>
    <div class="ui-footer ui-footer-stable ui-btn-group ui-border-t" style="display:none">
        <button class="ui-btn-lg ui-btn-primary" ms-click="sh(1)" >
            同意
        </button>
        <button class="ui-btn-lg ui-btn-danger" ms-click="sh(-1)">
            拒绝
        </button>
    </div>
    <section class="ui-container">
        <div class="ui-form ui-border-t">
            <div class="ui-form-item ui-border-b">
                <label>
                    申请人
                </label>
                <span class="wspan">{{modelData.ShenQingRen}}</span>
            </div>
            <div class="ui-form-item ui-border-b">
                <label>
                    开始时间
                </label>
                <span class="wspan">{{modelData.StarTime|date("yyyy-MM-dd")}}</span>
            </div>
            <div class="ui-form-item ui-border-b">
                <label>
                    结束时间
                </label>
                <span class="wspan">{{modelData.EndTime|date("yyyy-MM-dd")}}</span>
            </div>
            <div class="ui-form-item ui-border-b">
                <label>
                    请假天数
                </label>
                <span class="wspan">{{modelData.Daycount}}</span>

            </div>
            <div class="ui-form-item ui-border-b" style="height:auto">
                <label>
                    申请类型
                </label>
                <span class="wspan">{{modelData.LeiBie}}</span>
            </div>
            <div class="ui-form-item ui-border-b" style="height:auto;min-height:44px">
                <label>
                    事由
                </label>
                <span class="wspan" ms-html="modelData.ZhuYaoShiYou"></span>
            </div>
            <div class="ui-form-item ui-border-b" style="height:auto;min-height:44px">
                <label>
                    抄送人
                </label>
                <div class="ui-label-list" style="padding-left: 95px; margin:0;">
                    <label ms-repeat-el="ygData" class="ui-label" style="position: relative; width: auto;">{{el.UserRealName}}</label>
                </div>
                <!--<span class="wspan">{{modelData.ChaoSongRen}}</span>-->
            </div>
            <div class="ui-form-item ui-border-b">
                <label>
                    申请状态
                </label>
                <span class="wspan">{{qjzt(modelData.SPStatus,modelData.SPStatus1,isforbid)}}</span>
            </div>
        </div>
        <div class="ui-form" style="display:none;">
            <ul class="ui-grid-halve">
                <li>
                    <div class="ui-grid-halve-img">
                        <span style="background-image:url(http://placeholder.qiniudn.com/290x160)"></span>
                    </div>
                </li>
            </ul>

        </div>

    </section>
</body>
</html>
